import lyRequest from '@/service'

// 1.获取所有角色数据
export function getRoleList() {
  return lyRequest.get({
    url: '/role/selectRoleFormatList'
  })
}

// 2.获取权限树数据
export function getAssignTree(userId: number, roleId: number) {
  return lyRequest.get({
    url: `/role/getAssignTree`,
    params: {
      userId,
      roleId
    }
  })
}

// 3.更新权限
export function updateRolePermissions(info: any) {
  return lyRequest.post({
    url: `/role/saveAssign`,
    data: info,
    isShowMsg: true
  })
}
